package com.sojpt.boot.controller.business.validator;


import com.jfinal.core.Controller;
import com.jfinal.validate.Validator;
import com.sojpt.model.LkyApplyRecord;

/**
 * Description: 本类用于申请记录的添加
 * Created by SMW on 2020/2/13 20:34
 */
public class LkyApplyAddValidator extends Validator {


    @Override
    protected void validate(Controller controller) {

        LkyApplyRecord lkyApplyRecord = controller.getModel(LkyApplyRecord.class,"lkyApplyRecord");

        if (lkyApplyRecord.get("remark_info")!=null){
            validateString("lkyApplyRecord.remark_info",0,200,"msg","最多200个字符");
            validateRequired("lkyApplyRecord.remark_info", "msg", "请输入申请理由");
        }
    }

    @Override
    protected void handleError(Controller controller) {
        controller.renderJson();
    }
}
